package com.ruihu.admin.module.business.electric.config.domain.vo;

import com.ruihu.admin.module.business.electric.config.domain.dto.ElectricConfigDTO;
import lombok.Data;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;

/**
 *  [ 电芯型号维护表 ]
 *
 * @author Tony
 * @version 1.0
 * @company 瑞虎（南京）信息技术有限公司
 * @copyright (c) 瑞虎（南京）信息技术有限公司Inc. All rights reserved.
 * @date  2022-12-28 12:14:15
 * @since JDK1.8
 */

@Data
public class ElectricConfigVO {
    @ApiModelProperty("主键")
    private Long id;

    @ApiModelProperty("电芯编码")
    private String code;

    @ApiModelProperty("电芯类型")
    private String type;

    @ApiModelProperty("描述")
    private String remark;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    @ApiModelProperty("创建人")
    private Long creator;

    @ApiModelProperty("创建人名称")
    private String createByName;

    @ApiModelProperty("更新人")
    private Long updater;

    @ApiModelProperty("更新人名称")
    private String updateByName;

    public static ElectricConfigVO convertToElectricConfigVO(ElectricConfigDTO dto) {
        if (dto == null){
            return null;
        }
        ElectricConfigVO vo = new ElectricConfigVO();
        vo.setId(dto.getId());
         vo.setCode(dto.getCode());
         vo.setType(dto.getType());
         vo.setRemark(dto.getRemark());
         vo.setCreateTime(dto.getCreateTime());
         vo.setUpdateTime(dto.getUpdateTime());
         vo.setCreator(dto.getCreator());
         vo.setUpdater(dto.getUpdater());
         return vo;
    }
}
